package hrm.serviceimple;

import hrm.dao.MilitaryDAO;
import hrm.daoimple.MilitaryDAOImple;
import hrm.dto.insa.MilitaryDTO;
import hrm.service.MilitaryService;

import java.util.List;

public class MilitaryServiceImple implements MilitaryService {
	private MilitaryDAO militaryDAO;
	private static MilitaryServiceImple militaryService;
	
	private MilitaryServiceImple(){
		militaryDAO=new MilitaryDAOImple();
	}
	
	public static MilitaryServiceImple getInstance(){
		if (militaryService==null) {
			militaryService=new MilitaryServiceImple();
		}
		return militaryService;
	}

	public void setMilitaryDAO(MilitaryDAO militaryDAO) {
		this.militaryDAO = militaryDAO;
	}
	
	
	@Override
	public List<MilitaryDTO> getAllMilitary(MilitaryDTO dto) {
		return militaryDAO.getAllMilitary(dto);
	}


	@Override
	public boolean deleteMilitary(MilitaryDTO dto) {
		
		return militaryDAO.deleteMilitary(dto);
	}


	@Override
	public boolean insertMilitary(MilitaryDTO dto) {

		return militaryDAO.insertMilitary(dto);
	}


	@Override
	public boolean updateMilitary(MilitaryDTO dto) {

		return militaryDAO.updateMilitary(dto);
	}
	
}
